package cn.ctodb.cms.repository;

import cn.ctodb.cms.domain.CmsContent;

import org.springframework.data.jpa.repository.*;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * Spring Data JPA repository for the CmsContent entity.
 */
@SuppressWarnings("unused")
public interface CmsContentRepository extends JpaRepository<CmsContent,Long> {

    @Query("select distinct cmsContent from CmsContent cmsContent left join fetch cmsContent.tags")
    List<CmsContent> findAllWithEagerRelationships();

    @Query("select cmsContent from CmsContent cmsContent left join fetch cmsContent.tags where cmsContent.id =:id")
    CmsContent findOneWithEagerRelationships(@Param("id") Long id);

}
